<template>
  <div class="homeChild">
    <div>homechild</div>
    <div>{{ title }}</div>
    <div>
      <span>父组件传值1：</span>
      <span>{{ childrenData1 }}</span>
    </div>
    <div>
      <span>父组件传值2：</span>
      <span>{{ childrenData2 }}</span>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Prop, Component, Emit } from "vue-property-decorator";
@Component
export default class homeChild extends Vue {
  @Prop({ type: String }) childrenData1!: string;
  @Prop({ type: String }) childrenData2!: string;
  title = "homechild11111";
  data = "子组件传给父组件11111111111111";
  @Emit("event") getData(): string {
    console.log(999999999999999999);
    return this.data;
  }
  created() {
    try {
      this.getData();
    } catch {
      console.log("error");
    }
  }
}
</script>
